ci: re-run stale stack-dependent checks on stack shape changes - #54
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the stack breadcrumb reconciliation workflow to “true” stack-position-dependent CI gates by re-running stale failing stack-prefixed checks after stack shape changes, and aligns the OpenSpec archive workflow job names to that stack: naming convention.
Changes:
- Add stage-2 “recheck” logic to re-run the latest completed workflow run per workflow on affected open PRs when a
stack-prefixed job failed. - Rename OpenSpec PR-check job display names to
stack: positionandstack: openspec-archivedso they’re detectable as stack-dependent gates. - Introduce and unit-test
hasFailedStackJobhelper for identifying failed stack-prefixed jobs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/stack-breadcrumb.yml | Adds actions permission and stage-2 logic to re-run stale failing stack-dependent checks after stack shape changes. |
| .github/workflows/pr-check-openspec.yml | Renames job display names to stack:-prefixed names to mark stack-dependent gates. |
| .github/scripts/stack-breadcrumb.test.cjs | Adds unit tests covering hasFailedStackJob behavior across several cases. |
| .github/scripts/stack-breadcrumb.cjs | Adds hasFailedStackJob helper and exports it for use by the reconcile workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thecodedrift
added a commit
that referenced
this pull request
Jul 7, 2026
Address Copilot review on #54: only fetch a run's jobs when the run's overall conclusion is 'failure'. A non-failed run can't contain a failed job, so this avoids a listJobsForWorkflowRun call per workflow per PR and reduces rate-limit pressure on large stacks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thecodedrift
added a commit
that referenced
this pull request
Jul 7, 2026
Address Copilot review on #54: the JSDoc said 'workflow run' while the parameter is the run's job list; reword so the input (jobs) and the decision (re-run the run) are both accurate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"True" the stack: when a PR is stacked on/unstacked from another, GitHub does not re-run the other PR's checks, so a stack-position-dependent gate (the OpenSpec archive check) can stay failing on a PR that is no longer the tip. Hang a recheck off the existing breadcrumb dispatch (stage 2, from the default branch): for each PR in the affected stack, re-run any workflow run that has a FAILED job whose name is `stack`-prefixed. Green/skipped stack checks and non-stack failures (tests) are left alone, so nothing re-runs mid-stack when everything is already correct. - Name the stack-position-dependent jobs with a `stack` prefix so failures are identifiable: pr-check-openspec's jobs become "stack: position" and "stack: openspec-archived". - Add hasFailedStackJob() to the shared zero-dep module (unit-tested) — the reconcile job uses it to decide which runs to re-run; grant it actions: write. BREAKING for branch protection: renaming `check-openspec-archived` changes its check name. Any required-status-check config referencing the old name must be updated to "stack: openspec-archived" (and "stack: position") after this merges, or merges will hang waiting on a check that no longer reports.
Address Copilot review on #54: only fetch a run's jobs when the run's overall conclusion is 'failure'. A non-failed run can't contain a failed job, so this avoids a listJobsForWorkflowRun call per workflow per PR and reduces rate-limit pressure on large stacks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address Copilot review on #54: the JSDoc said 'workflow run' while the parameter is the run's job list; reword so the input (jobs) and the decision (re-run the run) are both accurate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thecodedrift
force-pushed
the
jakob/stack-recheck
branch
from
July 7, 2026 00:25
7a74f09 to
d5731be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Trueing" the stack. When you push A then stack B on it, GitHub doesn't re-run A's checks — so a stack-position-dependent gate (the OpenSpec archive check) stays failing on A even though A is no longer the tip (where it should skip). This closes that gap.
Approach (as discussed)
stack-prefixed. Green/skipped stack checks and non-stack failures (tests) are left alone — nothing re-runs mid-stack when everything's already correct.stackjob-name prefix identifies the gates.pr-check-openspec's jobs are renamed tostack: positionandstack: openspec-archived. Re-running the whole run re-computes position, so the archive job flips from failing → skipped once A is non-tip.stack-breadcrumb.cjsgraph logic. New pure logic (hasFailedStackJob) is unit-tested (5 cases); the reconcile job gainsactions: write.Renaming
check-openspec-archivedchanges its check name. If it (orDetect stack position) is a required status check in branch protection, update the names tostack: openspec-archived/stack: positionright after this merges — otherwise merges hang waiting on a check that no longer reports.Notes
.github/**); zero-dep.cjscovered bynode --test(46 tests, +5). Both workflows YAML-validated. Labeledskip-changeset(no release impact).main.🤖 Generated with Claude Code
https://claude.ai/code/session_01TEuUE3F23dgEyrkGPq3FiM